﻿#include "event.h"
#include <QObject>
#include "eventtimeout.h"
const QTimer &Event::getTimer() const {
    return timer;
}

bool Event::getInDay() const {
    return inDay;
}

void Event::setInDay(bool newInDay) {
    inDay = newInDay;
}

int Event::getImportance() const {
    return this->importance;
}

void Event::setImportance(int v) {
    if(v>=1)this->importance = 1;
    else this->importance = 0;
}

void Event::timeArrive() {
}

bool Event::getNeedRing() const {
    return needRing;
}

void Event::setNeedRing(bool value) {
    this->needRing = value;
}

Event::Event(QString name,QString decription,QDateTime time,QVector<QString> people,BellRings bellring)
    :name(name),description(decription),time(time),people(people) {
    this->needRing = true;
}

Event::Event(const Event &event) {
    this->bellRing = event.bellRing;
    this->description = event.description;
    this->name = event.name;
    this->people = event.people;
    this->time = event.time;
    this->timer.setInterval(event.getTimer().interval());
    this->importance = event.importance;
    this->needRing = true;

}

void Event::operator=(const Event &event) {
    this->bellRing = event.bellRing;
    this->description = event.description;
    this->name = event.name;
    this->people = event.people;
    this->time = event.time;
    this->timer.setInterval(event.getTimer().interval());
    this->importance = event.importance;
    this->needRing = true;
}


void Event::addPerson(QString name) {
    this->people.append(name);
}





































const QString &Event::getName() const {
    return name;
}

void Event::setName(const QString &newName) {
    name = newName;
}

const QString &Event::getDescription() const {
    return description;
}

void Event::setDescription(const QString &newDescription) {
    description = newDescription;
}

BellRings Event::getBellRing() const {
    return bellRing;
}

void Event::setBellRing(BellRings newBellRing) {
    bellRing = newBellRing;
}



const QDateTime &Event::getTime() const {
    return time;
}

void Event::setTime(const QDateTime &newTime) {
    time = newTime;
}

const QVector<QString> &Event::getPeople() const {
    return people;
}

void Event::setPeople(const QVector<QString> &newPeople) {
    people = newPeople;
}

